package com.example.feignapi.schedule;

import com.example.common.util.R;
import com.example.model.schedule.dto.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "leadnews-schedule", path = "/api/v1/")
public interface ScheduleClient {
    @PostMapping(value = "/task/addTask")
    R addTask(@RequestBody TaskDto taskDto);

    @GetMapping(value = "/task/cancel/{taskId}")
    R cancelTask(@PathVariable("taskId") long taskId);

    @GetMapping(value = "/task/poll/{type}/{priority}")
    R pollTask(@PathVariable("type") Integer type, @PathVariable("priority") Integer priority);
}
